# MessageHandler - MessageHandlers can be registered to the MessageBus
# Copyright (C) 2007 Lauri Taimila
# 
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

__licence__ = "GPLv2"
__copyright__ = "2007, Lauri Taimila"
__author__ = "Lauri Taimila <lauri@taimila.com>"

class MessageHandler(object):
    """
    MessageHandler interface determines MessageBus clients.
    
    All objects that are interested in any messages must implement this
    interface. MessageHandlers can be registered to the MessageBus. When
    Messages occur MessageBus notifies all registered MessageHandlers.
    """

    def handleMessage(self, message):
        """
        Deriving class should implement this method.
        This method should handle incoming messages quickly. In other words,
        this function should never block or take much time to finish. Use
        threads as needed.
        @param message: Received Message object 
        """
        pass
        
    def getName(self):
        """
        Deriving class should implement this method.
        This method should return human readable name of MessageHandler.
        """
        pass
